#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
	FILE *file;

	const char *filename = argv[1];

	file = fopen(filename,"r");
	if(file == NULL){
		perror("File is not exist or has been open！\n");
		return 1;
	}

	if(fclose(file) != 0){
		perror("File is damage!");
		return 1;
	}


	if(remove(filename) != 0){
		perror("File remove fault!\n");
		return 1;
	}

	printf("File \"%s\" has been remove!\n", filename);
	return 0;
}



